import './assets/main.css'
import webMonitor from '../../packages/core/src';
// import performance from '../../packages/performance/src';
// import recordscreen from '../../packages/recordscreen/src';

import { createApp } from 'vue'
import { createPinia } from 'pinia'

import App from './App.vue'
import router from './router'

const app = createApp(App)

app.use(createPinia())
app.use(router)
app.use(webMonitor, {
	dsn: 'http://localhost:8083/reportData',
	apikey: 'test-vue',
	silentWhiteScreen: true,
	skeletonProject: true,
	repeatCodeError: true,
	userId: '123',
	disabled:true,
	handleHttpStatus(data:any) {
		let { url, response } = data
		// code为200，接口正常，反之亦然
		let { code } = typeof response === 'string' ? JSON.parse(response) : response;
		if (url.includes('/getErrorList')) {
			return code === 200 ? true : false;
		} else {
			return true;
		}
	}
})

app.mount('#app')
